package j20251112;

public class Demo2 {
    public static void main(String[] args) {
        // 使用匿名内部类
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 3; i++) {
                    System.out.println("匿名内部类线程: " + i);
                }
            }
        });
        thread.start();
    }
}
